{include file="public/_meta" title="修改配置"/}
<div class="page-container">
	<form action="" method="post" class="form form-horizontal" id="form-config-edit">
		<div id="tab-config" class="HuiTab">
			<div class="tabCon">
				<input type="hidden" class="input-text" value="{$conf['id']}" placeholder="" name="id">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">
						<span class="c-red">*</span>
						中文名称：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="{$conf['ch_name']}" placeholder="请输入中文名称" id="ch_name" name="ch_name">
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">
						<span class="c-red">*</span>
						英文名称：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="{$conf['en_name']}" placeholder="请输入英文名称" id="en_name" name="en_name">
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">
						<span class="c-red">*</span>
						配置类型：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<span class="select-box">
						<select class="select" id="pid" name="config_type">
							<option {if condition="$conf['config_type'] eq 1"} selected="selected" {/if} value="1">单行文本框</option>
							<option {if condition="$conf['config_type'] eq 2"} selected="selected" {/if} value="2">单选按钮</option>
							<option {if condition="$conf['config_type'] eq 3"} selected="selected" {/if} value="3">复选框</option>
							<option {if condition="$conf['config_type'] eq 4"} selected="selected" {/if} value="4">下拉框</option>
							<option {if condition="$conf['config_type'] eq 5"} selected="selected" {/if} value="5">文本域</option>
							<option {if condition="$conf['config_type'] eq 6"} selected="selected" {/if} value="6">附件</option>
						</select>
						</span>
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">
						<span class="c-red">*</span>
						配置分类：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<span class="select-box">
						<select class="select" id="config_category" name="config_category">
							{volist name="list" id="vo"}
								<option value="{$key}" {if condition="$conf['config_category'] eq $key"} selected="selected" {/if}>{$vo}</option>
							{/volist}
						</select>
						</span>
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">
						<span class="c-red">*</span>
						默认值：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="{$conf['default_value']}" placeholder="请输入默认值（如有多个请用英文逗号分开）" id="default_value" name="default_value">
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">
						<span class="c-red">*</span>
						选中值：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="{$conf['optional_value']}" placeholder="请输入选项值（如有多个请用英文逗号分开）" id="optional_value" name="optional_value">
					</div>
					<div class="col-3">
					</div>
				</div>
				<div class="row cl">
					<div class="col-9 col-offset-3">
						<input class="btn btn-primary size-M radius" type="submit" value="提交">
						<button onClick="parent.layer.close(parent.layer.getFrameIndex(window.name));" class="btn btn-success size-M radius" type="button">取消</button>
					</div>
				</div>
			</div>
		</div>
	</form>
</div>

<!--_footer 作为公共模版分离出去-->
{include file="public/_footer" /}
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->

<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	$("#tab-config").Huitab({
		index:0
	});
	$("#form-config-edit").validate({
		rules:{
			
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){

			var data = $(form).serializeArray();
			$(form).ajaxSubmit({
				url : "{:url('system/edit_config')}",
				type : 'post',
				dataType : 'json',
				data : data,
				async : false,
				success : function(msg){
					//console.log(data);return;
					if(msg.status == true){
						layer.msg(msg.message,{icon: 6,time:1000});
						setTimeout(jump,1000);
						function jump(){
							parent.location.reload();
						}
					}else if(msg.status == false){
						layer.msg(msg.message,{icon: 5,time:1000});
					}
				}
			});
		}
	});
});
</script>
<!--/请在上方写此页面业务相关的脚本-->